import Vue from 'vue'
export default {
    namespaced: true,
    // 数据源
    state: {
        object: ['数学','语文','前端'],
        num:1
    },
    getters:{
        changeObject(state){
            return state.num='Vue框架'
        }
    },
    mutations:{
        changemath(state,val){
            state.object[0]='math'
        },
        changechina(state,val){
            Vue.set(state.object,1,val)
            // state.object[1]=val
        }
    },
    actions:{
        changechinaese(context,val){
            console.log(val);
            setTimeout(()=>{
                context.commit('changechina',val)
            },1000)
        }
    },
     // 模块化vuex
     modules: {

    }
}